#ifndef CHAPTER15_H_
#define CHAPTER15_H_
#include <iostream>
class Quote {
public:
	Quote() = default;
	Quote(const std::string &book, double sales_price):
		bookNo(book), price(sales_price){}
	
	std::string isbn() const { return bookNo; }

	virtual double net_price(const std::size_t n) const {
		return n * price;
	}
	virtual ~Quote() = default;
private:
	std::string bookNo;
protected:
	double price = .0;
};

class Bulk_quote : public Quote {
public:
	Bulk_quote(const std::string &, double, std::size_t, double);
	double net_price(const std::size_t n) const override;
private:
	std::size_t min_qty;
	
	double discount = .0;
};

Bulk_quote::Bulk_quote(const std::string &book, double price, std::size_t qty, double disc) :
	Quote(book, price), min_qty(qty), discount(disc){}

double Bulk_quote::net_price(const std::size_t n) const {
	if (n >= min_qty)
		return n * (1 - discount) * price;
	else
		return n * price;
}
#endif